<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户管理</title>
    <!--引入mui样式-->
    <link rel="stylesheet" href="../mstatic/resource/bootstrap-dist/css/bootstrap.css">
    <link rel="stylesheet" href="../mstatic/resource/bootstrap-dist/css/bootstrapValidator.css">
    <link rel="stylesheet" href="../mstatic/resource/bootstrap-dist/css/bootstrap-table.css">
    <link rel="stylesheet" href="../mstatic/resource/layer/2.4/skin/layer.css">
    <link rel="stylesheet" href="../mstatic/resource/zTree_v3/css/zTreeStyle/zTreeStyle.css">
    <link rel="stylesheet" href="../mstatic/resource/font-awesome-4.7.0/css/font-awesome.min.css">
    <script src="../mstatic/js/jquery/jquery.js"></script>
    <script src="../mstatic/resource/bootstrap-dist/js/bootstrap.min.js"></script>
    <script src="../mstatic/resource/bootstrap-dist/js/bootstrapValidator.js"></script>
    <script src="../mstatic/resource/bootstrap-dist/js/bootstrap-table.js"></script>
    <script src="../mstatic/resource/bootstrap-dist/js/bootstrap-table-zh-CN.js"></script>
    <script src="../mstatic/resource/layer/2.4/layer.js"></script>
    <script type="text/javascript" src="../mstatic/resource/zTree_v3/js/jquery.ztree.all.min.js"></script>
    <script type="text/javascript" src="../mstatic/js/btnLimit.js"></script>
    <script src="../mstatic/js/userManagement.js"></script>

</head>
<body>
<div class="page-container" style="padding: 10px 20px 20px 20px;">
    <div class="btn-group" id="toobar" role="group" aria-label="...">
        <button type="button" class="dis btn btn-primary" value="添加" onclick="user.openAddUser()">
            <span class="glyphicon glyphicon-plus"></span> 添加
        </button>
        <button type="button" class="dis btn btn-warning" value="修改" onclick="user.openUpdateUser()">
            <span class="glyphicon glyphicon-edit"></span> 修改
        </button>
        <button type="button" class="dis btn btn-danger" value="删除" onclick="user.deleteUser()">
            <span class="glyphicon glyphicon-trash"></span> 删除
        </button>
    </div>
    <!--用户信息表格-->
    <table id="userList" class="table table-border table-bordered table-bg table-hover table-sort responsive" ></table>

    <!--添加用户的窗口-->
    <div id="addUserDialog" class="modal fade" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true" ms-controller="storelocationMage">
        <div class="modal-dialog" role="document" style="height: 410px;width: 500px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="changeUser">添加用户</h4>
                </div>
                <div class="modal-body">
                    <form id="addUserForm" class=" form-horizontal required-validate">
                        <input type="text" id="idUser" name="id" style="display: none" class="form-control">

                        <div class="form-group" style="margin: 10px 0px 10px 5px;">
                            <label class="col-sm-3 control-label">用户名称</label>
                            <div class="col-sm-9">
                                <input type="text" id="account" name="account" style="width: 300px" class="form-control" placeholder="请输入用户名称">
                            </div>
                        </div>
                        <div class="form-group" style="margin: 10px 0px 10px 5px;">
                            <label class="col-sm-3 control-label">用户名</label>
                            <div class="col-sm-9">
                                <input type="text" id="userName" name="userName" style="width: 300px" class="form-control" placeholder="请输入用户名称">
                            </div>
                        </div>
                        <div class="form-group" style="margin: 10px 0px 10px 5px;">
                            <label class="col-sm-3 control-label">电话</label>
                            <div class="col-sm-9">
                                <input type="text" id="phone" name="phone" style="width: 300px" class="form-control" placeholder="手机号或固话（例：010-00000000）">
                            </div>
                        </div>
                        <div class="form-group" style="margin: 10px 0px 10px 5px;">
                            <label class="col-sm-3 control-label">邮箱</label>
                            <div class="col-sm-9">
                                <input type="text" id="email" name="email" style="width: 300px" class="form-control" placeholder="请输入邮箱">
                            </div>
                        </div>
                        <div class="form-group show_none" style="margin: 10px 0px 10px 5px;">
                            <label class="col-sm-3 control-label">密码</label>
                            <div class="col-sm-9">
                                <input type="password" id="pwd" name="password" style="width: 300px" class="form-control" placeholder="请输入密码">
                            </div>
                        </div>
                        <div class="form-group show_none" style="margin: 10px 0px 10px 5px;">
                            <label class="col-sm-3 control-label">确认密码</label>
                            <div class="col-sm-9">
                                <input type="password" id="zuserPwd" name="zuserPwd" style="width: 300px" class="form-control" placeholder="请再次输入密码">
                            </div>
                        </div>

                        <div class="form-group" style="margin: 10px 0px 10px 5px;">
                            <label class="col-sm-3 control-label">性别</label>
                            <div class="col-sm-9">
                                <select id="sex" name="sex" class="form-control" style="width: 300px">
                                    <option value="2" disabled>请选择</option>
                                    <option value="0">未知</option>
                                    <option value="1">男</option>
                                    <option value="2">女</option>
                                </select>
                            </div>
                        </div>
                        <div align="center" style="margin: 15px 0px 15px 0px">
                            <button type="button" class="btn btn-info" onclick="user.submitAddUser()" >提交</button>
                            <button type="button" class="btn btn-info" onclick="user.resetAddUser($('#changeUser').html())" >重置</button>
                        </div>
                    </form>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <!--组织结构-->
    <div id="Origin-tree" class="modal fade" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true" ms-controller="storelocationMage">
        <div class="modal-dialog" role="document" style="height: 410px;width: 500px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="Z-Tree">组织机构</h4>
                </div>
                <div class="modal-body">
                    <form id="treeForm" class=" form-horizontal required-validate">
                        <div class="form-group" style="margin: 10px 0px 10px 5px;">
                            <label class="col-sm-3 control-label">组织机构</label>
                            <div class="col-sm-9">
                                <div class="zTreeDemoBackground">
                                    <ul id="treeDemo" class="ztree"></ul>
                                </div>
                            </div>
                        </div>

                        <div align="center" style="margin: 15px 0px 15px 0px">
                            <button type="button" class="btn btn-info" onclick="sureTree()" >确定</button>
                            <button type="button" class="btn btn-info" id="cancelBtn" >取消</button>
                        </div>
                    </form>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <!--配置角色-->
    <div id="cfgUser" class="modal fade" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true" ms-controller="storelocationMage">
        <div class="modal-dialog" role="document" style="height: 450px;width: 500px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="changeRole">配置角色</h4>
                </div>
                <div class="modal-body">
                    <input type="text" id="userIds" style="display: none">  <!--隐藏域保存当前点击行的userId-->
                    <div style="margin:10px 20px">
                        <div id="cfgTool">
                            <button type="button" class="btn btn-primary" onclick="user.saveConfig()">
                                保存
                            </button>
                        </div>
                        <table id="cfgTable" class="table table-border table-bordered table-bg table-hover table-sort responsive"></table>
                    </div>
                </div>

            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <!--配置基地-->
    <div id="cfgCK" class="modal fade" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true" ms-controller="storelocationMage">
        <div class="modal-dialog" role="document" style="height: 410px;width: 500px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="changePt">配置基地</h4>
                </div>
                <div style="margin:10px 20px">
                    <input type="text" id="baseIds" style="display: none">
                    <div id="cfgCKTool">
                        <button type="button" class="btn btn-primary" onclick="user.saveCKConfig()">
                            保存
                        </button>
                    </div>
                    <table id="cfgCKTable" class="table table-border table-bordered table-bg table-hover table-sort responsive"></table>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
</div>
</body>
</html>